<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>10self</title>
<style>
  .mask{
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content{
    width: 40%;
    height: 40%;
    background-color: #fff;
  }
</style>
</head>
<body>

  <div id='app'>
    <button @click="showMask">显示弹窗</button>
    <div class="mask" @click.self="closeMask" v-show="isShow">
      <!-- <div class="content" @click.stop> -->
      <div class="content">
        <button>123212</button>
        <span>21342</span>
        sadadas
      </div>
    </div>
  </div>

<script src='https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js'></script>
<script>
  const app = new Vue({
    el: '#app'
    ,data:{
      isShow: false
    }
    ,methods:{
      showMask(){
        this.isShow = true
      }
      ,closeMask(){
        this.isShow = false
      }
    }
  })
</script>
</body>
</html>